<?php

class Setting_IndexController extends YouNet_Controller_Action
{
	public function shareAction() {
        $id_page = $this->_getParam('id_page', null);
        $id_campaign = $this->_getParam('id_campaign', null);
        
        if (!Core_Util::isFacebookRequest()) {
            YouNet_Util::parentRedirect($this->_social->pageUrl(array(), $id_page));
        } else {
             
            $model_tbl_setting =  Setting_Model_DbTable_SettingsFanPage::getInstance();
            
            $setting_info = $model_tbl_setting->getRowSetting($id_campaign);
            
            $this->view->share_info = $setting_info;
            $this->view->id_page = $id_page;
            $this->view->id_campaign = $id_campaign;
        }
    }
}

